-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: mongodb integration test #154
base: main
Are you sure you want to change the base?
Conversation
Hey @cygaar thanks for the help in fixing this very annoying integration test! Retrying until the search index has been created is indeed the right way of fixing this. However, Instead, I think the way to do this is to poll the // in `create_search_index` after creating the index
while attempts < max_attempts {
match collection
.list_search_indexes()
.name(index_name)
.await?
.with_type::<rig_mongodb::SearchIndex>()
.next()
{
Some(index) if index.status == "READY" => return,
Some(_) => continue
None => panic!()
}
} |
I'll fix shortly! |
@cvauclair I'm pretty sure the logic I have here works - I added a log to check if the index was created and it seems to work. |
@cygaar apologies I wasn't very clear. The value returned by The docs suggest using |
ah cool, i'll look into that |
FYI I had increased the delay further to 30s in another PR that has since been merged (hence the merge conflict), but feel free to reduce it back to 5s (or remove it entirely) once the polling for READY status is done! |
I will note that the creation of the search index is what's causing the original error - we would essentially need to keep the logic i currently have and add an additional check to make sure the index was created |
@cvauclair i think the last test failure is related to missing api keys - not entirely sure how you guys have github actions setup to get that to work |
Previously, the mongo integration test was failing with
Error connecting to Search Index Management service.
. This is because it takes a bit of time for the container to initialize the service.The extra delay added in #153 doesn't quite fix the issue because the index creation happens before the delay.
Our integration tests will now retry a couple of times before attempting to create the index.